<template>
  <q-layout view="hHh lpR fFf">
    <q-header class="bg-white h-15 text-zinc-500" height-hint="20">
      <div class="flex  justify-between m-5">
        <div>
          Here is icon
          <router-link class="ml-6 hover:cursor-pointer hover:text-blue-300" :to="{ name: 'index' }"
            active-class="text-blue-300">
            首页
          </router-link>
          <span v-if="token === void 0" class=" ml-6 hover:cursor-pointer hover:text-blue-300"> 去登录</span>
          <router-link v-else class=" ml-6 hover:cursor-pointer hover:text-blue-300" active-class="text-blue-300"
            :to="{ name: 'person', query: { user_id: user_id } }"> 我的文章</router-link>
          <router-link class=" ml-6 hover:cursor-pointer hover:text-blue-300" active-class="text-blue-300"
            :to="{ name: 'write', query: { user_id: user_id } }"> 去发布</router-link>
          <router-link class="ml-6 hover:cursor-pointer hover:text-blue-300" active-class="text-blue-300"
            :to="{ name: 'collection', query: { user_id: user_id } }">我的收藏</router-link>
        </div>
        <div>
          <router-link exact-active-class="text-blue-300" class="hover:text-blue-200 hover:cursor-pointer ml-8"
            :to="{ name: 'group', query: { group: '中餐' } }">中餐</router-link>
          <router-link exact-active-class="text-blue-300" class="hover:text-blue-200 hover:cursor-pointer ml-8"
            :to="{ name: 'group', query: { group: '西餐' } }">西餐</router-link>
          <router-link exact-active-class="text-blue-300" class="hover:text-blue-200 hover:cursor-pointer ml-8"
            :to="{ name: 'group', query: { group: '甜点' } }">甜点</router-link>
        </div>
      </div>
    </q-header>

    <q-page-container class=" w-full h-full">
      <router-view class="w-full m-auto h-full" />
    </q-page-container>

  </q-layout>
</template>

<script setup>
import { useRouter, useRoute } from 'vue-router';
import { getOne } from 'src/boot/collections';
const route = useRoute()
const router = useRouter()
import { ref } from 'vue'
const token = ref(localStorage.getItem('toekn'))
const user_id = ref(localStorage.getItem('user_id'))

const query = route.query
getOne({ user_id: query.user_id }).then(res => {
  let data = res.data
})


</script>
